<?
$tags = $this->tags;
?>
<script src="/src/my.js"></script>
<script src="jscripts/tiny_mce/jquery.tinymce.js"></script>


<div id="update_edit">
    <div class="wrapper_header wrapper_up4 bg3 wrapper_width24">
        <h3>Business Profile : Adding micronews</h3>
    </div>

    <div>

        <?=$this->tovar['name']?>
    </div>
    <div>
        Desc:<?=$this->tovar['description']?>
    </div>
</div>

<? //endforeach;?>

<a href="#" onclick="Edit(); return false;"> edit</a>

<div id="edit" style="display:none;">
    <form method="post" action="/tovar/update">
        <div>

            <input type="hidden" name="id" value="<?= $this->tovar['id'] ?>">

            <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
            <div>
                <textarea id="description" name="description" rows="15" cols="80" style="width: 80%" class="tinymce">
                    <?=$this->tovar['description']?>
                </textarea>
            </div>


            <br/>
            <input name="update_desc" class="button" type="button" value="Update description"
                   onclick="UpdateDesc(<?=$this->tovar['id']?>); return false;"/>

            <br/>

            <label for="item-tags">Тэги:</label>

            <select id="item-tags" name="item-tags">
                <? foreach ($tags as $tag): ?>

                <option value="<?= $tag['id'] ?>" class="selected"><?= $tag['name'] ?></option>

                <? endforeach; ?>
            </select>

            <br/>
            <br/>


            <input type="submit" name="save" value="Submit"/>
            <input type="reset" name="reset" value="Reset"/>
        </div>
    </form>
</div>


<!--<script type="text/javascript">-->
<!--    google.load("jquery", "1");-->
<!--</script>-->


<script type="text/javascript">
    $().ready(function() {
        $('textarea.tinymce').tinymce({
            // Location of TinyMCE script
            script_url : 'http://localhost/jscripts/tiny_mce/tiny_mce.js',

            // General options
            theme : "advanced",
            plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",

            // Theme options
            theme_advanced_buttons2 : "",
            theme_advanced_buttons3 : "",
//                theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_statusbar_location : "bottom",
            theme_advanced_resizing : true,

            // Example content CSS (should be your site CSS)
            content_css : "http://localhost/css/styles.css",

            // Drop lists for link/image/media/template dialogs
            template_external_list_url : "lists/template_list.js",
            external_link_list_url : "lists/link_list.js",
            external_image_list_url : "lists/image_list.js",
            media_external_list_url : "lists/media_list.js",

            // Replace values for the template plugin
            template_replace_values : {
                username : "Some User",
                staffid : "991234"
            }
        });
    });
</script>
<!-- /TinyMCE -->


<script type="text/javascript">
    if (document.location.protocol == 'file:') {
        alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
    }
</script>



<script type="text/javascript">
    $(document).ready(function() {
        $("#item-tags").fcbkcomplete({
            json_url: "/ajax/search/",
            addontab: true,
            maxitems: 5,
            height: 2,
            cache: true
        });
    });
</script>

